/*
 *This is a modified verison the the ECGA tool, see the disclaimer and the readme to more information about the original one.
 *
 *This version is modified to be embedded into this evolable framework.
 *
 *
 *
 */


// -*- c++ -*-
//
//  File:         ecga.hpp
//
//  Description:  C++ interface for the ecga class.
//
//  Author:       Fernando Lobo
//
//  Date:         June/1999
//
//  Modified to be compliant with gcc 3.4 by Kumara Sastry
//  Date:        March/2006

#ifndef _ecga_hpp
#define _ecga_hpp

#include <cstdlib>
#include <iostream>
#include <fstream>
#include <iomanip>

#include "population.hpp"
#include "../Validator.hpp"
#include "../popolazione.hpp"
#include "parameter.hpp"
#include "parameter.hpp"
#include "population.hpp"
#include "mpm.hpp"
#include "utility.hpp"

class ecga
{
  private:
    void report( std::ofstream &outfile, population *pop, int gen );
    bool done( population *pop, int gen );
	//Parameters list
	parameter *pr;
	//Random number generator
	randomG *rndg;
	//Population rapresentation
	population *pop;

  public:
    ecga(parameter *pra, randomG * rndga, Validator * val);
	~ecga() {
		delete(pr);
		delete(rndg);
	}
	/*
	 *Val: the Validator to evaluate all the individuals
	 *step_size, the number of generation cosidered for this step.
	 */
    Popolazione * run(Validator * val,int step_size);
};

#endif



